import Vue from "vue"
import Router from "vue-router"

Vue.use(Router)

export function createRouter() {
    return new Router({
        mode: "history",
        scrollBehavior: () => ({ x: 0, y: 0 }),
        routes: [
            {
                path: "/",
                component: () => import("../components/Index"),
                children: [
                    {
                        path: '',
                        component: () => import("../components/List")
                    }
                ]
            },
            {
                path: "/list",
                component: () => import("../components/List"),
            },
            {
                path: "/item/:id",
                component: () => import("../components/Item"),
            },
        ]
    })
}